EMT Practice Test

1. Question Content...


Question List

Question1: Which of the following methods can be invoked by a message-driven bean?
Each correct answer represents a complete solution. Choose all that apply.

Question2: Mark works as a Programmer for InfoTech Inc. He creates a program that uses the following code.
1. class Book
2. {
3. Short f1= 15;
4. Book GetDetails(Book b1)
5. {
6. b1=null;
7. return b1;
8. }
9. public static void main(String args[])
10. {
11. Book b1 = new Book();
12. Book b2 = new Book();
13. Book b3 = b1.GetDetails(b2);
14. b1=null;
15. //code
16. }
17. }
How many objects will be eligible for garbage collection when line 15 is reached?

Question3: Which of the following statements about the <auth-constraint> element are true?
Each correct answer represents a complete solution. Choose all that apply.

Question4: Mark works as a Software Developer for ZenTech Inc. He writes the following code.
1. public class Ques0352 {
2. public static void main(String[] args) {
3. String s1="JavaObject";
4. String s1="ObjectJava";
5. String s2="ObjectJava";
6. if(s2.equals(s1))
7. { System.out.println("Equal"); }
8. else
9. { System.out.println("Unequal"); }
10. }
11. }
Which of the following will happen to the code when he attempts to compile and run it?

Question5: Which of the following are advantages of client-side JavaScript?
Each correct answer represents a complete solution. Choose two.

Question6: Identify whether the given statement is true or false.
"When an exception occurs in a try block, each catch statement following the try block is inspected in sequential order, and the last one whose type matches that type of exception is executed."

Question7: Peter works as a Software Developer for Neon Inc. He is developing an application in Java. He declares an interface. Which of the following field declarations are valid within the body of an interface?
Each correct answer represents a complete solution. Choose three.

Question8: In which of the following cases is the GET method used to retrieve information?
Each correct answer represents a complete solution. Choose all that apply.

Question9: Mark works as a Programmer for InfoTech Inc. He develops the following code for a Web application named JavaSecurity Application.
<web-app . . . .>
<display-name>A JavaSecurity Application</display-name>
<servlet>
...
<security-role-ref >
<role-name>Manager</role-name>
<role-link>Admin</role-link>
</security-role-ref>
</servlet>
<security-role>
<role-name>Programmer</role-name>
</security-role>
<security-role>
<role-name>Admin</role-name>
</security-role>
<security-role>
<role-name>Employee</role-name>
</security-role>
</web-app>
Which of the following will be the action of the container if the request is HttpServletRequest, and request.isUserInRole("Admin"); has been called in a servlet code?

Question10: You have the following code fragment of a Java program named test.
12. public void getData(){
13. ArrayList numbers=new ArrayList();
14. for(int i=0; i<10;1++){
15. int value=i*((int i) Math.random());
16. Integer obj=new Integer(value);
17. numbers.add(obj);
18. }
19. System.out.println(numbers);
20. }
On which of the following lines of code will the object referenced by obj be eligible for garbage collection?

Question11: Mark works as a Programmer for InfoTech Inc. He develops a program that defines a class named Inventory that has an instance variable named NumOfItems. Which of the following properties will be applied by NumOfItems?
Each correct answer represents a complete solution. Choose all that apply.

Question12: Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.
1. public class Garbage
2. {
3. public static void main(String args[])
4. {
5. String line;
6. String first="it is a program";
7. String last="last argument";
8. String arg1=new String((args.length>0) ? "'" + args[0] + "'" . "no arguments");
9. line=arg1;
10. arg1=null;
11. line=first + line + last;
12. first=null;
13. System.out.println("line");
14. line=null;
15. last=null;
16. args=null;
17. }
18. }
Which of the following statements about the code snippet is true when an object is initially referenced with arg1, and it is eligible for garbage collection?

Question13: You have the following code of a PreparedStatement.
PreparedStatement stm = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID
= ?");
Which of the following statements are true about a PreparedStatement?
Each correct answer represents a complete solution. Choose all that apply.

Question14: Identify whether the given statement is true or false.
"When a Java program starts up, one thread begins running immediately."

Question15: Sam works as a Software Developer for Gentech Inc. He writes the following code.
1. class TryFinallyTest {
2. public static void main(String[] args) {
3. try {
4. int i=15/0;
5. System.out.println("Testing Try");
6. }
7. catch(ArithmeticException ae) {
8. System.out.println("Arithmetic exception");
9. }
10. System.out.println("Correct");
11. finally {
12. System.out.println("Must execute");
13. }
14. }
15. }
What will happen when he attempts to compile and execute the code?

Question16: Which of the following statements about the form-based authentication are true?
Each correct answer represents a complete solution. Choose two.

Question17: Which of the following actions can you take to seal two packages, PackageA and PackageB, in the JAR file MyJar.jar?
Each correct answer represents a complete solution. Choose all that apply.

Question18: What will be the output of the following code snippet?
class test22
{
public static void main(String args[])
{
String str= new String("Hello");
str.insert(3,"bye");
System.out.println(str);
}
}

Question19: You develop an application. Now you want to ensure that data is sent between client and server in such a way that it cannot be changed in transit. Which of the following element declarations will be specified to satisfy the requirement of the application?

Question20: Which of the following statements about various authentication mechanisms in J2EE are true?

Question21: Which of the following init() method calls initializes a cipher object with a key in the SECRET_MODE?

Question22: Which of the following elements is used as a parameter in the EJBContext.isCallerInRole() method?

Question23: Which of the following access modifiers is allowed for the constructor for a session bean class?

Question24: Which of the following modifiers is not an access modifier?

Question25: You work as a Software Developer for Relix Inc. You have written the following code. class Test {protected void show(){}} Now you want to override the method show() in the subclass of Test. Which of the following access specifiers can you use to override this method?
Each correct answer represents a complete solution. Choose two.

Question26: Which of the following mechanisms is closely related to authorization?

Question27: Which of the following circumstances can prevent the execution of code in a finally block?
Each correct answer represents a complete solution. Choose two.

Question28: Which of the following CLDC connector modes is used only for data input over a connection?

Question29: Mark works as a Programmer for InfoTech Inc. He develops an application named JavaServices. He wants to declare a security constraint that will restrict everything in the com/files directory so that security role of Admin can invoke any http methods on the resources. Which of the following element declarations will be used to accomplish the task?

Question30: Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.

Question31: Which of the following methods reinitializes the logging properties?

Question32: Which of the following elements can be used to obtain a database connection?

Question33: Which of the following is the correct syntax for the JVM garbage collection?

Question34: Which of the following exceptions will be thrown by the validate method if the result type does not match the Source type, or if the specified source is neither SAXSource nor DOM Source?

Question35: Which of the following code is used to create an object of security manager?

Question36: You work as a Software Developer for UcTech Inc. You want to write a filter that will implement the Filter interface. Which of the following methods will you use to accomplish the task?
Each correct answer represents a complete solution. Choose all that apply.

Question37: Which of the following statements about a native modifier in Java are true?
Each correct answer represents a complete solution. Choose two.

Question38: Given the following directory structure.

Assuming that the current directory is com, which of the below options can be used to create a jar file called TestJar.jar that contains all the files from the directory testApp?

Question39: Which of the following data type values is returned by the System.in.read() console input function?

Question40: Identify whether the given statement is true or false.
"JAR files can be used while compiling but not while executing other files."

Question41: Which of the following authentications uses HTTPS (HTTP over SSL) to verify a user?

Question42: Which of the following are valid class declarations?
Each correct answer represents a complete solution. Choose all that apply.

Question43: Identify whether the given statement is true or false.
"There is no method to create a new thread other than extending the Thread class."

Question44: Which of the following is a valid constructor for the DataInputStream class?

Question45: Which of the following JDBC interfaces is described in the statement below?
"It provides support for executing SQL statements and stored procedures."

Question46: Which of the following elements contains the <filter> element in the deployment descriptor?

Question47: Which of the following classes implements the java.lang.Cloneable and java.lang.Runnable interfaces correctly?

Question48: You work as a Programmer for InfoTech Inc. You write the following code.
1. public class InnerDemo{
2. public static void main(String[] args) {
3. Car c = new Car();
4. // insert code here
5. e.test();
6. }
7. }
8. class Car{
9. class Engine{
10. void test() {System.out.println("test"); }
11. }
12. }
Which of the following options should you add to line 4 so that the code compiles and produces the output
"test"?

Question49: Which of the following statements about serialization are true?
Each correct answer represents a complete solution. Choose all that apply.

Question50: Identify whether the given statement is true or false.
"A try statement can be placed inside the code block that follows another try statement."

Question51: Which of the following exceptions is thrown if a class uses the clone() method but does not implement the Cloneable interface?

Question52: Which of the following web-resource element descriptions will be used if you want to restrict all URL's in the application and perform authentication for the http delete method?

Question53: Identify whether the given statement is true or false.
"If the isUserInRole() method is called on an unauthenticated user, the container returns false."

Question54: Which of the following code declarations are valid error-page declarations?
Each correct answer represents a complete solution. Choose all that apply.

Question55: You have created a Java application that will retrieve and insert data into a database table. Which of the following objects will you use to pass the JDBC Driver to obtain a connection to the database server?

Question56: There are two threads defined in an application named "thread1" and "thread2". Which of the following options can be the direct cause of "thread1" becoming blocked?
Each correct answer represents a complete solution. Choose all that apply.

Question57: Identify whether the given statement is true or false.
"An object becomes eligible for garbage collection when it becomes unreachable by any code."

Question58: You work as a Programmer for InfoTech Inc. You develop two html pages named authenticate.jsp and error.jsp, which are deployed directly at the root of the Web application named Authentication. Which of the following deployment descriptor code declarations will be used to ensure that the error.jsp page will be displayed automatically if the client is not authenticated?

Question59: Which of the following exceptions will be thrown by the getFeature() method if the feature value cannot be assigned or retrieved?

Question60: Which of the following statements are true about Vector and ArrayList?
Each correct answer represents a complete solution. Choose all that apply.

Question61: Which of the following methods throws a SecurityException if the calling thread is not allowed to open a socket connection to the specified host and port number?

Question62: Which of the following methods can be invoked from the ejbStore() method of an entity bean class?
Each correct answer represents a complete solution. Choose all that apply.

Question63: Mark works as a Programmer for InfoNet Inc. He writes the following programs.
1. package book;
2. public class read
3. {
4. (access modifier) int r1=10;
5. }
1. package book1;
2. import book.read;
3. class Doread extends read
4. {
5. public void test()
6. {
7. System.out.println("The value of r1 is." +r1);
8. }
9. }
Which of the following access modifiers will be put in the place of the word, (access modifier), to compile the program successfully?

Question64: You work as a Software Developer for UcNet Inc. You write the following code using Java.
class StringTest
{
public static void main(String args[])
{
String s = "Hi";
s.concat("There");
System.out.println(s);
}
}
What will happen when you try to compile and execute the code?

Question65: Which of the following methods is used by the AccessController to determine whether or not a requested permission is used by another permission that is known to be valid in the current execution context?

Question66: Which of the following statements about ServletContext attributes is true?

Question67: The following JSP scriptlet is given.
<% response.setContentType("text/html; charset=ISO-8859-1"); %>
Which of the following directives is the equivalent directive for the scriptlet given above?

Question68: Which of the following permission classes is an abstract class ancestor of all permissions and defines the essential functionalities required for all permissions?

Question69: Mark works as a Programmer for InfoTech Inc. He develops a class named Data that imports all the required packages. The class Data uses a method named PrintData(), which uses a method that checks whether the caller has a BeanUser security role. Which of the following code of the method PrintData() will satisfy the requirement?

Question70: Wilbert works as a Software Developer for Wintos Inc. He writes the following code.
1. public class tcf
2. {
3. public static void main(String[] args)
4. {
5. try
6. {
7. int x = 5 / 0;
8. System.exit(0);
9. }
10. catch(ArithmeticException e)
11. {
12. System.out.println("Within catch");
13. }
14. finally
15. {
16. System.out.println("Within finally");
17. }
18. }
19. }
What will happen when he tries to compile and execute the code?

Question71: Mark works as an Application Developer for XYZ Solutions Inc. He writes the following code.
public class TestDemo{public static void main(String[] args){
{try{int x =0;int d= 5/x;}catch(Exception ex){System.out.println("Exception");} catch(ArithmeticException ae){System.out.println("Arithmetic Exception");}}} What is the result when Mark tries to compile and execute the code?

Question72: Which of the following JAR file options is used for creating an archive?

Question73: You work as a Software Developer for UcTech Inc. You want to ensure that a class is informed whenever an attribute is added, removed, or replaced in a session. Which of the following is the event that you will use to accomplish the task?

Question74: Which of the following methods are used to customize object serialization so that the objects will be able to apply default serialization?
Each correct answer represents a complete solution. Choose two.

Question75: Which of the following attribute scopes does not exist for a Servlet?

Question76: Which of the following methods of the HttpSession interface can be called upon an invalidated session without throwing the IllegalStateException?

Question77: Which of the following methods specifies which LoginModules should be used for a particular application, and in what order the LoginModules should be invoked?

Question78: You work as a Software Developer for TechnoZen Inc. You create an application using Java. You define a method, named myMethod. You also define a class, named myClass, within myMethod.
Which of the following rules governs the access to the variables of the enclosing method?

Question79: Which of the following instantiation code will you use to create an instance of the inner class SunAssociate, which is written inside the Developer outer class?

Question80: Identify whether the given statement is true or false.
"JAR files can be used while compiling but not while executing other files."

Question81: You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the ADMIN role. The EmpSal() method can be accessed only by the HR role, while the EmpAttendance () method can be accessed only by the DBA role. You want the EmpAttendance() method to be accessed by the HR role also. However, no other roles in the class except ADMIN, DBA, and HR should be able to access the EmpAttendance() method. Which of the following steps will you take to accomplish the task?
Each correct answer represents a complete solution. Choose all that apply.

Question82: Which of the following code fragments will compile without error?
Each correct answer represents a complete solution. Choose all that apply.

Question83: For which of the following purposes is the AccessController class used?
Each correct answer represents a complete solution. Choose all that apply.

Question84: Which of the following is the valid permission for a BasicPermission?

Question85: You work as a Software Developer for BlueTech Inc. You create code using EJB 3.0. You want to ensure that each new record is checked for validation before it is inserted into the database. Which of the following callback methods will you use to write the logic for validation?

Question86: Which of the following methods of the javax.ejb.EJBContext interface allows the bean provider to access security information about the enterprise bean's caller?
Each correct answer represents a complete solution. Choose all that apply.

Question87: Which of the following, in JDBC 2.0, are the sub interfaces of the Statement interface?
Each correct answer represents a complete solution. Choose two.

Question88: Which of the following syntaxes is used to run the application packaged as a JAR file?

Question89: Which of the following code snippets will read the eighth byte of the file wRead.txt into the variable str?

Question90: Which of the following methods belongs to the FilterConfig interface and ServletConfig interface both?
Each correct answer represents a complete solution. Choose all that apply.

Question91: Which of the following classes enables a programmer to create an object and protect its confidentiality with a cryptographic algorithm?

Question92: Which of the following validates an HTML form at client-side before submitting it to the server?

Question93: Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.
import java.util.*;
public class DemoSet{
public static void main(String[] args){
TreeSet<String> ts = new TreeSet<String>();
ts.add("Sunday");
ts.add("Friday");
ts.add("Wednesday");
ts.add("Sunday");
ts.add("Monday");
Iterator it = ts.iterator();
while(it.hasNext()){
System.out.print(it.next() + " ");
}
}
}
What will be the output when he tries to execute the given code snippet?

Question94: The deployment descriptor uses the __________ element to pass control to an error page when an exception is thrown.

Question95: Which of the following exceptions will be thrown if the commit() method fails?

Question96: You write the following code.
class Father {public void Method() {System.out.println("I am Father");}} public class Son extends Father {public static void main(String argv[]) {Son son = new Son();son.Method ();} private void Method() {System.out.println("I am Son");}} Which of the following will be the result, when you try to compile and run the code?

Question97: Which of the following methods performs the authentication of subject and, if successful, associates Principals and Credentials with the authenticated Subject?

Question98: Which of the following statements about the <web-resource-collection> element are true?
Each correct answer represents a complete solution. Choose all that apply.

Question99: Which of the following exceptions will be thrown if a cipher is in decryption mode but the decrypted data is not bounded by the appropriate bytes?

Question100: Which of the following methods are overridden by the FileInputStream class?
Each correct answer represents a complete solution. Choose all that apply.

Question101: Mark works as a Programmer for InfoTech Inc. He develops the following security-constraint code.
<security-constraint>
<web-resource-collection>
<web-resource-name>Manager</web-resource-name>
<url-pattern>/acme/Manager/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
//<auth-constraint/> code
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Manager</web-resource-name>
<url-pattern>/acme/Manager/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
//<auth-constraint/> code
</security-constraint>
Which of the following <auth-constraint> element declarations of the <security-constraint> will allow everybody to access the same resources?

Question102: Martin works as a Programmer in Data Net Inc. He writes the following code.
1. class Ques0191{
2. public static void main(String[] argv){
3. byte a = 1;
4. switch(a+1){
5. case 1.
6. System.out.println("One");
7. case 2.
8. System.out.println("2");
9. case 2.
10. System.out.println("Two"); break;
11. }
12. }
13. }
What will happen when Martin attempts to compile and execute the code?

Question103: The java.util.logging package provides the classes and interfaces of the Java platform's core logging facilities. Which of the following are the main target uses of logs?
Each correct answer represents a complete solution. Choose all that apply.

Question104: Which of the following exceptions will a compiler throw when a number is divided by zero?

Question105: Which of the following classes is an engine class designed to provide conversions between opaque cryptographic keys and allows you to build an opaque key object from a given key specification?

Question106: Which of the following elements of the java.util.logging package exports objects to a variety of destinations including memory, output streams, consoles, files, and sockets?

Question107: Which of the following roles will release a servlet instance for garbage collection after the destroy method completes?

Question108: Which of the following methods returns a Cipher object that implements the specified transformation?

Question109: You work as a Software Developer for NewTech Inc. You want to configure the deployment descriptor so as to specify the error pages used in the FORM based authentication. Which of the following elements will you use to accomplish the task?

Question110: Which of the following statements about exceptions in message-driven beans are true?
Each correct answer represents a complete solution. Choose two.

Question111: Which of the following is used to restore the objects that have been previously serialized by a stream?

Question112: Which of the following methods is used to encrypt or decrypt data in a single step?

Question113: Which of the following JAR file options creates and includes a manifest file?

Question114: Mark works as a Programmer for InfoTech Inc. He develops a session bean class named accountService.
Which of the following rules must be conformed by the session bean class?
Each correct answer represents a complete solution. Choose all that apply.

Question115: Which of the following are valid method signatures of the getInstance() method of the Policy class?
Each correct answer represents a complete solution. Choose all that apply.

Question116: You work as a Software Developer for UcTech Inc. You want to declare a security constraint in the deployment descriptor using the <transport-guarantee> element. Which of the following can be the possible values for the element?
Each correct answer represents a complete solution. Choose all that apply.

Question117: Which of the following will be the result if an integer overflow occurs in an operation?

Question118: You work as programmer for PassGuide.Inc. You have purchased a Web application named SecureProgrammer that uses the programmatic authorization, and the security roles that are not used in your organization. Which of the following deployment descriptor elements must you use so that the SecureProgrammer application can work with your organization?

Question119: Which of the following code fragments will throw NumberFormatException?

Question120: Which of the following TextField constraints hides the input while a user is entering the data in the text box?

Question121: Mary works as a Software Developer for XYZ Inc. She writes the following code.
1. class Alpha {
2. public static class Beta { }
3. }
4. class Delta {
5. // insert code here
6. }
Which of the following code statements can be inserted at line 5 to create an instance of the Beta class defined in the class Alpha?

Question122: Mark works as a Programmer for InfoTech Inc. He develops the following code snippet.
1. public class Header
2. {
3. //code//
4. {
5. System.out.println("Print the code.");
6. super.finalize();
7. }
8. }
Which of the following header statements should be placed at line 3 to execute the program successfully?

Question123: Samantha works as a Software Developer for Bluetech Inc. She develops a class Warden that needs to access the Hostel class. The Hostel class is deployed in a JAR named City.JAR. What should be done so that during compilation the Warden class has access to the Hostel class?

Question124: You work as a Programmer for InfoTech Inc and develop the following two
<security-constraint>
declarations.
<security-constraint>
<web-resource-collection>
<web-resource-name>Manager</web-resource-name>
<url-pattern>/acme/Manager/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Manager</web-resource-name>
<url-pattern>/acme/Manager/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Manager</role-name>
</auth-constraint>
</security-constraint>
Which of the following statements is true about the <auth-constraint> in the code given above?

Question125: You work as a Software Developer for Developer Inc. You write the following code.
interface A {public boolean b = false;}
class C implements A {public static void main(String args[]) {b = true;System.out.println(b);}} Which of the following will be the result, when you try to compile and execute the above code?

Question126: Which of the following statements about the isCallerInRole() method are true?
Each correct answer represents a complete solution. Choose all that apply.

Question127: Which of the following is a mandatory sub-element of the <web-resource-collection> element of the deployment descriptor?

Question128: Mark works as a Programmer for InfoTech Inc. He develops a Java application that uses the encryption and compression techniques. Which of the following interfaces will he use to control the serialization and deserialization processes?

Question129: The ______________ method of the EJBContext interface tests whether the client is a member of the role specified in the argument to the method.

Question130: You work as a Software Developer for UcTech Inc. You build an online book shop, so that users can purchase books using their credit cards. You want to ensure that only the administrator can access the credit card information sent by users. Which security mechanism will you use to accomplish the task?

Question131: Harry works as a Software Developer for SoftTech Inc. He has developed a Java application to perform various SQL statements such as INSERT, UPDATE, etc., against a database table named Employee. He has used the executeUpdate() method to perform various SQL queries and to know the exact affected rows in the database if any of the operations is performed against the database table.
Which of the following types of values is returned by this method?

Question132: Peter works as a Programmer in Magi Net Inc. He writes the following code.
1. class Ques0190{
2. public static void main(String[] argv){
3. byte a = 100;
4. switch(a){
5. case 10.
6. System.out.println("ten");
7. case 100.
8. System.out.println("hundred");
9. case 1000.
10. System.out.println("thousand");
11. }
12. }
13. }
What will happen when Peter attempts to compile and execute the code?

Question133: Which of the following classes of java.util.logging prints a brief summary of the LogRecord in a human readable format?

Question134: Which directory in JAR files is used to store package and extension configuration data?

Question135: Which of the following methods is used to preallocate room for a certain number of characters after a StringBuffer has been constructed?

Question136: Which of the following conditions must be satisfied before the HTTP client authentication mechanism is used?
Each correct answer represents a complete solution. Choose all that apply.

Question137: You work as a Web Deployer for UcTech Inc. You write the <security constraint> element for an application in which you write the <auth-constraint> sub-element as follows.
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
Who will have access to the application?

Question138: Which of the following statements make a message-driven bean different from a session bean?
Each correct answer represents a complete solution. Choose all that apply.

Question139: Mary works as a Software Developer for ABC Solutions Inc. She writes the following code.
public class StringMethods {
public static void main(String[] args) {
String str = new String("abc");
str.concat("xyz");
StringBuffer strBuf = new StringBuffer(" 123");
strBuf.append(" no");
System.out.println(str + strBuf);}}
What will be the output when Mary tries to compile and execute the code?

Question140: Which of the following exceptions will be thrown if the caller does not have permission to invoke the doAsPrivileged method?

Question141: Which of the following security related elements of the deployment descriptor matches the argument to the isCallerInRole() method?

Question142: Which of the following methods is used to authenticate the users, and if the user has not been authenticated, the method returns false?

Question143: The __________ interface accepts results from a SQL SELECT statement.

Question144: Which of the following methods must be implemented by each subclass of the Permission class to compare permissions?

Question145: What will be the output of the following program?
class Stringtest
{
public static void main(String args[])
{
String s= "test";
s.concat("paper");
System.out.println(s);
}
}

Question146: You work as a Software Developer for UcTech Inc. You are building a Web site that will contain study materials on the Java language. The company wants that members can access all the pages, but nonmembers have only limited access to the Web site pages. Which of the following security mechanisms will you use to accomplish the task?

Question147: Which of the following authentication flag values will force authentication to continue to proceed down the LoginModule list, irrespective of whether the LoginModule succeeds or fails?
Each correct answer represents a complete solution. Choose all that apply.

Question148: Dennis works as a Programmer in Broadnet Inc. He writes the following program.
1. public class Ques0307{
2. public static void main(String[] argv){
3. int arr[] = {1, 2, 3, 4};
4. try{
5. int k = 0;
6. for(; k < 4; k++)
7. arr[k] = arr[k] + 1;
8. System.out.println("try");
9. }
10. catch(ArrayIndexOutOfBoundsException a){
11. System.out.println("index " +k +" not found");
12. }
13. catch(Exception e){
14. System.out.println("catch1");
15. }
16. finally{
17. System.out.println("finally");
18. }
19. }
20. }
What will happen when Dennis attempts to compile and execute the program?

Question149: Given below are top-level class declarations. Which of these class declarations would not produce a compile-time error?
abstract class P {} //1
private class Q {} //2
static class R {} //3
transient class S {} //4

Question150: According to the EJB programming restrictions, which of the following should be used to access the files or directories?